package com.wlhse.service.impl;

import com.wlhse.dao.ProblemImportDaoV2;
import com.wlhse.exception.WLHSException;
import com.wlhse.service.ProblemImportServiceV2;
import com.wlhse.util.R;
import com.wlhse.util.state_code.CodeDict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

//v2
@Service("ProblemImportDaoV2")
public class ProblemImportServiceV2Impl implements ProblemImportServiceV2 {

    @Autowired
    private ProblemImportDaoV2 problemImportDaoV2;

    @Override
    @Transactional
    public R updateResponsePersonID(List<Integer> problemIds, int usrId) {
        int i = problemImportDaoV2.updateResponsePersonID(problemIds, usrId);
        if (i<=0)
            throw new WLHSException(CodeDict.UPDATE_FAILE,"更新问题责任人失败");
        return new R();
    }
}
